home *** CD-ROM | disk | FTP | other *** search
/ AGA Toolkit '97 / The AGA Toolkit '97.iso / miscellaneous / time / message / message.a < prev    next >
Encoding:
Text File  |  1996-09-07  |  34.8 KB  |  823 lines

  1.  
  2.  
  3. ;            --------------------- MESSAGE ---------------------
  4. ;
  5. ;     MESSAGE  is  a  reminder  program  which  repeats  back to you a
  6. ;     message after a specified number of minutes.  A typical example
  7. ;     would be to "Turn off the sprinkler" after 15 minutes.
  8. ;
  9. ;     This  is  version two of a very simple program.  Version one was
  10. ;     written  in Pascal, was WB2+ only, and was missing a function I
  11. ;     needed.  Here is the assembly version!
  12. ;
  13. ;     It's  smaller,  faster  and  should  hum  along on all breeds of
  14. ;     Amigas.
  15. ;
  16. ;     MESSAGE has two windows.  The first has a string gadget in which
  17. ;     you can type a message of up to 128 characters.
  18. ;
  19. ;     There  is  also  a  "minutes"  gadget which will take an integer
  20. ;     value  of up to 9999 minutes (about 7 days).  You quit from this
  21. ;     "entry"  window  by  either  selecting  the  "OK" gadget, which
  22. ;     activates  the  timer,  or  by clicking the close window gadget
  23. ;     which halts the program.
  24. ;
  25. ;     After  your  designated  time,  the message window will pop up.
  26. ;     This window has your message inside.  At this time, all screens
  27. ;     should "flash" and your machine should "beep".
  28. ;
  29. ;     You  can  either  quit from this window by selecting "OK" or the
  30. ;     close   gadget,   both  of  which  will  halt  the  program,  or
  31. ;     alternatively  you  may request a "REPEAT" of the message, which
  32. ;     will restart the timer.
  33. ;
  34. ;     I  hope that you find this program useful.  If not, feel free to
  35. ;     use it as a pot plant holder.  If it stomps all over your Amiga,
  36. ;     I'm sorry, but you use it at your own risk!
  37. ;
  38. ;     This  program  is  FREEWARE, as is the source code.  Copy it and
  39. ;     enjoy it.
  40. ;
  41. ;     Anthony Peck
  42. ;     68 Woralul St
  43. ;     Waramanga ACT 2611
  44. ;     AUSTRALIA
  45. ;
  46. ;     Anthony.Peck@Radford.act.edu.au
  47. ;
  48. ;     Thanx to my bestest friend and loyal supporter Kym.  She makes
  49. ;     great coffee and even better kids!
  50. ;
  51. ;     Compiler report
  52. ;     ---------------
  53. ;     935 lines in 0.82 sec = 68414 lines/min.
  54. ;     Global symbols: 97
  55. ;     Local symbols:  6
  56. ;     Bytes gained by optimization: 200
  57. ;     Code:   1 section(s)     1725 bytes
  58. ;     Data:   1 section(s)     1568 bytes
  59. ;     BSS:  none
  60.  
  61. ; Some Useful Definitions
  62. ; -----------------------
  63. ;
  64. ; You'll find all of these in the various includes that come with
  65. ; a compiler like DevPac.  Some are defined in structures such as
  66. ; "GADGET", while others are library offsets.  If you are stuck for
  67. ; such definitions, check out HexTract by Chas Wyndham (Fish 817).
  68.  
  69. ; Simple equivalents
  70.  
  71. ExecBase                = $04      ; ExecBase (!)
  72. Wd_rport                = $32      ; Window RastPort (Window structure)
  73. Wd_userport             = $56      ; Window UserPort (Window structure)
  74. Pr_cli                  = $ac      ; CLI offset in process structure
  75. Pr_msgport              = $5c      ; Message port for process structue
  76. Im_class                = $14      ; Class for IDCMP message
  77. Iaddress                = $1c      ; Address of IDCMP message
  78. Gg_gadgetid             = $26      ; Gadget ID (Gadget structure)
  79. Gadgetup                = $40      ; Gadget pressed
  80. Gadclosewindow          = $200     ; Close window pressed
  81. NumChars                = $10      ; Number of chars in stringinfo
  82.  
  83. ; Library Vector Offsets
  84.  
  85. _LVOOpenLibrary         = -$0228   ; Exec function - "Old" for WB1.3
  86. _LVOCloselibrary        = -$019e   ; Exec function
  87. _LVOOpenwindow          = -$CC     ; Intuition function
  88. _LVODelay               = -$C6     ; Dos function
  89. _LVOPrintIText          = -$D8     ; Intuition function
  90. _LVOWaitport            = -$0180   ; Exec function
  91. _LVOFindtask            = -$0126   ; Exec function
  92. _LVOForbid              = -$84     ; Exec function
  93. _LVOClosewindow         = -$48     ; Intuition function
  94. _LVOSetwindowtitles     = -$0114   ; Intuition function
  95. _LVOGetmsg              = -$0174   ; Exec function
  96. _LVOReplymsg            = -$017a   ; Exec function
  97. _LVODisplayBeep         = -$60     ; Intuition function
  98.  
  99. ; Some Useful Macros
  100. ; ------------------
  101. ;
  102. ; Macros waste memory and increase the size of the code, but they
  103. ; make life a bit easier and the code a bit more readable.  All of
  104. ; these are used to access the appropriate library functions.  The
  105. ; library bases are loaded, the LVO prefix is added, and then the
  106. ; function is called.  Simple!
  107.  
  108. Callexec        Macro
  109.         Move.L  ExecBase,A6        ; Move Exec into a6
  110.         Jsr     _LVO\1(A6)         ; Add Library offset and call function
  111.                 Endm
  112.  
  113. Callint         Macro
  114.         Move.L  _intuitionbase,A6  ; Move Intuition into a6
  115.         Jsr     _LVO\1(A6)         ; Add Library offset and call function
  116.                 Endm
  117.  
  118. Calldos         Macro
  119.         Move.L  _dosbase,A6        ; Move Dos into a6
  120.         Jsr     _LVO\1(A6)         ; Add Library offset and call function
  121.                 Endm
  122.  
  123. ; Wb Startup Code
  124. ; ---------------
  125. ;
  126. ; I modified this slightly from that which is provided with the
  127. ; includes that come with DevPac.  You can get similiar code
  128. ; in the Public Domain, see STARTUPS on Fish 101.  All they do is
  129. ; allow you to start your program from WB.
  130.  
  131.         Movem.L  D0/A0,-(Sp)        ;    save initial values
  132.         Clr.L    Returnmsg          ;    clear message
  133.         Sub.L    A1,A1              ;    subtract address
  134.         Callexec Findtask           ;    find this task
  135.         Move.L   D0,A4              ;    move process to a4
  136.         Tst.L    Pr_cli(A4)         ;    test if we are from CLI
  137.         Beq      Fromworkbench      ;    otherwise go to workbench
  138.         Movem.L  (Sp)+,D0/A0        ;    restore registers
  139.         Bra      End_startup        ;    and run the program
  140.  
  141. Fromworkbench:
  142.  
  143.         Lea      Pr_msgport(A4),A0  ;    load the message port
  144.         Callexec Waitport           ;    wait for a message
  145.         Lea      Pr_msgport(A4),A0  ;    load the message port
  146.         Callexec Getmsg             ;    then get it
  147.         Move.L   D0,Returnmsg       ;    save it for later reply
  148.         Movem.L  (Sp)+,D0/A0        ;    restore registers
  149.  
  150. End_startup:
  151.  
  152.         Jsr      Start              ;    call the program
  153.  
  154.         Move.L   D0,-(Sp)           ;    save it
  155.         Tst.L    Returnmsg          ;    test if message
  156.         Beq      Exittodos          ;    if I was a CLI
  157.         Callexec Forbid             ;    forbid(!)
  158.         Move.L   Returnmsg(Pc),A1   ;    load message
  159.         Callexec Replymsg           ;    message received!
  160.  
  161. Exittodos:
  162.  
  163.         Move.L   (Sp)+,D0           ;    exit code
  164.         Rts
  165.  
  166. ; Program Starts Here
  167. ; -------------------
  168. ;
  169. ; The above code points to this Start identifier, which is where
  170. ; the actual program starts!
  171.  
  172. Start:
  173.  
  174.         Jsr      Openint            ; Open intuition library
  175.         Jsr      Opendos            ; Open dos library
  176.         Jsr      Win1               ; Open first window
  177.         Jsr      Changetitle        ; Change the screen title
  178.  
  179. Mainloop:
  180.  
  181. ; This bit of code waits for messages from the first window and then
  182. ; processes them.
  183.  
  184.         Jsr      Waitformess        ; Bide time until user inputs
  185.         Move.L   Winhd,A0           ; Move window handle into a0
  186.         Move.L   Wd_userport(A0),A0 ; UserPort offset
  187.         Callexec Getmsg             ; Macro gets window message
  188.         Move.L   D0,A1              ; Message transferred to a1
  189.         Move.L   A1,Message         ; Message saved for analysis
  190.         Callexec Replymsg           ; Message received!
  191.         Move.L   Message,A0         ; Load message into a0
  192.         Move.L   Im_class(A0),D6    ; Message class offset
  193.         Cmpi.L   #Gadclosewindow,D6 ; Was the close gadget pressed
  194.         Beq      Cleanup            ; Yes!  Outta here...
  195.         Move.L   Iaddress(A0),A0    ; Gadget address offset
  196.         Move.L   Gg_gadgetid(A0),D5 ; Gadget ID offset
  197.  
  198.         Cmpi.L   #$30000,D5         ; Was the "OK" gadget pressed
  199.         Beq      Errors             ; Yes!  See if there are any errors
  200.  
  201.         Bra      Mainloop           ; Head back if gadget 1 or 2 ->
  202.  
  203. Errors:
  204.  
  205. ; If the "OK" gadget was pressed, we need to check to see that some
  206. ; basic conditions have been satisfied.  E.g. Has an message been
  207. ; specified?  And a time?
  208.  
  209. CheckMessage:
  210.  
  211.         Lea     Messageinfo,A2      ; Load the message structure
  212.         Move.W  NumChars(A2),D3     ; Move to number of characters offset
  213.         Tst.W   D3                  ; Test if anything was entered
  214.         Bne     CheckTime           ; If OK move on...
  215.         Move.L  #$00,A0             ; All screens to beep!
  216.         Callint DisplayBeep         ; Beep the display to wake up user
  217.         Lea     NoInput,A1          ; ...else load the message pointer...
  218.         Bra     ErrorMessage        ; ...and display the error
  219.  
  220. CheckTime:
  221.  
  222.         Lea     Minutesinfo,A2      ; Load the minutes structure
  223.         Move.W  NumChars(A2),D3     ; Move to number of characters offset
  224.         Tst.W   D3                  ; Test if anything was entered
  225.         Bne     DisplayMess         ; If OK move on...
  226.         Move.L  #$00,A0             ; All screens to beep!
  227.         Callint DisplayBeep         ; Beep the display to wake up user
  228.         Lea     NoTime,A1           ; ...else load the message pointer...
  229.         Bra     ErrorMessage        ; ...and display the error
  230.  
  231. DisplayMess:
  232.  
  233. ; The second window displays the message specified by the user, and gives
  234. ; them the option of repeating the message, or quitting the program.
  235.  
  236.         Jsr      Closewin           ; Close the first window
  237.         Lea      Minutesinfo,A5     ; Load the Minutes structure
  238.         Move.L   $1C(A5),D1         ; Move the integer entered to D1
  239.         Mulu     #$0BB8,D1          ; Multiply by 50 ticks and 60 seconds
  240.         Calldos  Delay              ; Waiting!
  241.         Jsr      Win2               ; Open the new window
  242.         Jsr      Changetitle        ; Change the screen title
  243.  
  244.         Move.L  #$00,A0             ; All screens to beep!
  245.         Callint DisplayBeep         ; Beep the display to wake up user
  246.  
  247.         Move.L   #$10,xoff          ; Reset values in case this is the
  248.         Move.L   #$10,yoff          ; second (etc.) time around
  249.         Move.L   xoff,D0            ; Move x-offset to D0
  250.         Move.L   yoff,D1            ; Move y-offset to D1
  251.         Move.L   Winhd,A0           ; Load window handle
  252.         Move.L   Wd_rport(A0),A0    ; Shift to window rast port
  253.         Lea      MSTitletxt,A1      ; The text structure...
  254.         Callint  PrintIText         ; ...and write it!
  255.  
  256.         Lea      Messagebuff,A2     ; Load the infile structure
  257. 1$      Clr.L    D4                 ; Clear our character counter
  258.         Add.L    #$0C,yoff          ; Shift offset to next line
  259.         Jsr      ClearTemp          ; Clear the temporary buffer
  260.         Lea      Tempbuff,A3        ; Load temporary buffer
  261. 2$      Move.B   (A2)+,D3           ; Shift one character and increment
  262.         Cmp.B    $00,D3             ; Was it a dud?
  263.         Beq      4$                 ; Yes!  Outta here ->
  264.         Move.B   D3,(A3)+           ; ...else shift it into temp buffer
  265.         Addq.B   #$01,D4            ; Add 1 to counter
  266.         Cmp.B    #$3C,D4            ; Have we reached 60?
  267.         Beq      3$                 ; Yes!  Outta here ->
  268.         Bra      2$                 ; ...else branch to next character
  269. 3$      Move.B   -(A3),D3           ; Move back one character
  270.         Clr.B    (A3)               ; Clear it from the temp buffer
  271.         Cmp.B    #$20,D3            ; Is it a space?
  272.         Beq      4$                 ; Yes!  Outta here ->
  273.         Move.B   D3,-(A2)           ; Else shift it back to Messagebuff...
  274.         Bra      3$                 ; ...and go back to next character ->
  275. 4$      Move.L   xoff,D0            ; Move x-offset to D0
  276.         Move.L   yoff,D1            ; Move y-offset to D1
  277.         Lea      Temptxt,A1         ; The text structure
  278.         Move.L   Winhd,A0           ; Move in window handle
  279.         Move.L   Wd_rport(A0),A0    ; Shift to window rast port
  280.         Callint  PrintIText         ; Print it!
  281.         Cmp.B    #$20,D3            ; Was that last one a space?
  282.         Bne      5$                 ; No!  Outta here ->
  283.         Bra      1$                 ; ...else back to next line ->
  284.  
  285. 5$      Jsr      Waitformess        ; Bide time until user inputs
  286.         Move.L   Winhd,A0           ; Move window handle into a0
  287.         Move.L   Wd_userport(A0),A0 ; UserPort offset
  288.         Callexec Getmsg             ; Macro gets window message
  289.         Move.L   D0,A1              ; Message transferred to a1
  290.         Move.L   A1,Message         ; Message saved for analysis
  291.         Callexec Replymsg           ; Message received!
  292.  
  293.         Move.L   Message,A0         ; Load message into a0
  294.         Move.L   Im_class(A0),D6    ; Message class offset
  295.         Cmpi.L   #Gadclosewindow,D6 ; Was the close gadget pressed
  296.         Beq      Cleanup            ; Yes!  Outta here...
  297.         Move.L   Message,A0         ; ...else Load message into a0
  298.         Move.L   Iaddress(A0),A0    ; Gadget address offset
  299.         Move.L   Gg_gadgetid(A0),D5 ; Gadget ID offset
  300.  
  301.         Cmpi.L   #$10000,D5         ; Was the "OK" gadget pressed
  302.         Beq      Cleanup            ; Yes!  Bye ->
  303.  
  304.         Cmpi.L   #$20000,D5         ; Was the "REPEAT" gadget pressed
  305.         Beq      DisplayMess        ; Yes!  Back to the start ->
  306.  
  307.         Bra      Cleanup            ; Anything else? (Not likely - but
  308.                                     ; just to be sure...
  309.  
  310. ErrorMessage:
  311.  
  312.         Move.L  Winhd,A0            ; Move window handle into a0
  313.         Lea     Screentitle,A2      ; Load the screen title into a2
  314.         Callint Setwindowtitles     ; Macro changes screen title
  315.         Bra     Mainloop            ; Back to the mainloop ->
  316.  
  317. ; Subroutines
  318. ; -----------
  319. ;
  320. ; These sections of code are either re-used several times, or are
  321. ; just easy to put somewhere at the end of the program where no-one
  322. ; will mind too much!
  323.  
  324. Openint:
  325.  
  326. ; The opening of the intuition library, including an error branch if things
  327. ; don't go according to plan!
  328.  
  329.         Lea      Intname,A1         ; Load intuition library into a1
  330.         Callexec OpenLibrary        ; Macro opens library
  331.         Beq      Exittodos          ; If it doesn't open, we quit
  332.         Move.L   D0,_intuitionbase  ; Save the return address
  333.         Rts                         ; ...and back at you ->
  334.  
  335. Opendos:
  336.  
  337. ; The opening of the dos library, including an error branch if things
  338. ; don't go according to plan!
  339.  
  340.         Lea      Dosname,A1         ; Load dos library into a1
  341.         Move.L   #$00,D0            ; Any version will do
  342.         Callexec OpenLibrary        ; Macro opens library
  343.         Beq      NoDos              ; If there's a problem, close down
  344.         Move.L   D0,_dosbase        ; Save the return address
  345.         Rts                         ; ...and back at you ->
  346.  
  347. NoDos:
  348.  
  349. ; If dos fails to open, we need to close intuition.
  350.  
  351.         Jsr     Closeint            ; Jump to close intuition subroutine
  352.         Bra     Exittodos           ; Then off!
  353.  
  354. Win1:
  355.  
  356. ; This little bit opens the first window.
  357.  
  358.         Lea     Win1_defs,A0        ; Load window definitions to a0
  359.         Jsr     Openwin             ; Open the window
  360.         Rts                         ; ...and back at you ->
  361.  
  362. Win2:
  363.  
  364. ; This little bit opens the second window.
  365.  
  366.         Lea     Win2_defs,A0        ; Load window definitions to a0
  367.         Jsr     Openwin             ; Open the window
  368.         Rts                         ; ...and back at you ->
  369.  
  370. Waitformess:
  371.  
  372. ; Rather than check all the time if the window has spoken to intuition,
  373. ; we use the userport of the window structure to wait for a message
  374. ; before doing anything else.  Low maintenance!
  375.  
  376.         Move.L   Winhd,A0           ; Move window handle into a0
  377.         Move.L   Wd_userport(A0),A0 ; UserPort offset at byte 86
  378.         Callexec Waitport           ; Macro waits for message from window
  379.         Rts                         ; ...and back at you ->
  380.  
  381. Changetitle:
  382.  
  383. ; Here we change the workbench screen title.
  384.  
  385.         Move.L  Winhd,A0           ; Move window handle into a0
  386.         Movea.L #-1,A1             ; Move current window title into a1
  387.         Lea     Screentitle,A2     ; Load the screen title into a2
  388.         Callint Setwindowtitles    ; Macro changes screen title
  389.         Rts                        ; ...and back at you ->
  390.  
  391. Openwin:
  392.  
  393. ; Just calls the function and stores the window handle.
  394.  
  395.         Callint Openwindow          ; Macro opens window
  396.         Move.L  D0,Winhd            ; Save return address (window handle)
  397.         Rts                         ; ...and back at you ->
  398.  
  399. ClearTemp:
  400.  
  401. ; Here we clear the 60 bytes of the Temporary buffer.
  402.  
  403.         Move.B  #$3C,D1             ; Move 60 counter to D4
  404.         Lea     Tempbuff,A5         ; Load the temp buffer
  405. 1$      Move.B  #$00,(A5)+          ; Clear a byte and increment
  406.         Subq.B  #$01,D1             ; Decrease counter by 1
  407.         Cmpi.B  #$00,D1             ; At zero yet?
  408.         Bne     1$                  ; No!  Go back ->
  409.         Rts                         ; ...else return
  410.  
  411. Cleanup:
  412.  
  413. ; Finally it's over, but before we can go home we need to do some quick
  414. ; housekeeping!
  415.  
  416.         Jsr     Closewin            ; Close window
  417.         Jsr     Closedos            ; Close dos
  418.         Jsr     Closeint            ; Close intuition
  419.     Rts                         ; back to startup code
  420.  
  421. Closewin:
  422.  
  423. ; Closes the window.
  424.  
  425.         Move.L  Winhd,A0            ; Move window handle into a0
  426.         Callint Closewindow         ; Macro closes window down
  427.         Rts                         ; ...and back at you ->
  428.  
  429. Closedos:
  430.  
  431. ; Closes the dos library.
  432.  
  433.         Move.L   _dosbase,A1        ; Move dos base into a1
  434.         Callexec Closelibrary       ; Macro closes dos
  435.         Rts                         ; ...and back at you ->
  436.  
  437. Closeint:
  438.  
  439. ; Closes the intuition library.
  440.  
  441.         Move.L   _intuitionbase,A1  ; Move intuition base into a1
  442.         Callexec Closelibrary       ; Macro closes intuition
  443.         Rts                         ; ...and back at you ->
  444.  
  445. ; Structures and Memory Allocation
  446. ; --------------------------------
  447. ;
  448. ; Here are the definitions held for the structures used in the
  449. ; program, as well as memory blocks Set aside for definitions such
  450. ; as the messages.
  451.  
  452. Win1_defs:
  453.  
  454. ; Window structure
  455.  
  456.         Dc.W    $B4                ; x-offset on screen
  457.         Dc.W    $5D                ; y-offset on screen
  458.         Dc.W    $118               ; window width
  459.         Dc.W    $46                ; window height
  460.         Dc.B    $01                ; print colour
  461.         Dc.B    $03                ; background colour
  462.         Dc.L    $00000240          ; IDCMP flags: CLOSEWINDOW|GADGETDOWN
  463.         Dc.L    $0000100e          ; ACTIVATE|WINDOWDRAG|WINDOWDEPTH
  464.                                    ; WINDOWCLOSE
  465.         Dc.L    GadInput           ; First Gadget
  466.         Dc.L    $00                ; Standard Checkmark
  467.         Dc.L    Winname            ; Window name
  468.         Dc.L    $00                ; screen pointer
  469.         Dc.L    $00                ; no custom bitmap
  470.         Dc.W    $00,$00,$00,$00    ; intuition sets these given that...
  471.         Dc.W    $01                ; this is a WORKBENCH screen
  472.  
  473. Win2_defs:
  474.  
  475. ; Window structure
  476.  
  477.         Dc.W    $44                ; x-offset on screen
  478.         Dc.W    $5D                ; y-offset on screen
  479.         Dc.W    $01F4              ; window width
  480.         Dc.W    $46                ; window height
  481.         Dc.B    $01                ; print colour
  482.         Dc.B    $03                ; background colour
  483.         Dc.L    $00000240          ; IDCMP flags: CLOSEWINDOW|GADGETDOWN
  484.         Dc.L    $0000100e          ; ACTIVATE|WINDOWDRAG|WINDOWDEPTH
  485.                                    ; WINDOWCLOSE
  486.         Dc.L    GadOK2             ; First Gadget
  487.         Dc.L    $00                ; Standard Checkmark
  488.         Dc.L    Winname            ; Window name
  489.         Dc.L    $00                ; screen pointer
  490.         Dc.L    $00                ; no custom bitmap
  491.         Dc.W    $00,$00,$00,$00    ; intuition sets these given that...
  492.         Dc.W    $01                ; this is a WORKBENCH screen
  493.  
  494. GadInput:
  495.  
  496. ; Gadget structure
  497.  
  498.         Dc.L    GadTime            ; next gadget
  499.         Dc.W    $1C                ; x-offset on window
  500.         Dc.W    $14                ; y-offset on window
  501.         Dc.W    $DC                ; gadget width
  502.         Dc.W    $0E                ; gadget height
  503.         Dc.W    $04                ; Inverted Image type
  504.         Dc.W    $01                ; RELVERIFY
  505.         Dc.W    $04                ; STRING
  506.         Dc.L    InMessage          ; Data for picture of gadget
  507.         Dc.L    $00                ; Alternative image
  508.         Dc.L    Inputtxt           ; text around gadget
  509.         Dc.L    $00                ; no mutual exclude
  510.         Dc.L    Messageinfo        ; special string info
  511.         Dc.W    $01                ; Gadget Identification
  512.         Dc.L    $00                ; no User Data
  513.  
  514. GadTime:
  515.  
  516. ; Gadget structure
  517.  
  518.         Dc.L    GadOK1             ; next gadget
  519.         Dc.W    $1C                ; x-offset on window
  520.         Dc.W    $32                ; y-offset on window
  521.         Dc.W    $2D                ; gadget width
  522.         Dc.W    $0D                ; gadget height
  523.         Dc.W    $04                ; Inverted Image type
  524.         Dc.W    $801               ; RELVERIFY|INTEGER
  525.         Dc.W    $04                ; STRING
  526.         Dc.L    Time               ; Data for picture of gadget
  527.         Dc.L    $00                ; Alternative image
  528.         Dc.L    Timetxt            ; text around gadget
  529.         Dc.L    $00                ; no mutual exclude
  530.         Dc.L    Minutesinfo        ; special string info
  531.         Dc.W    $02                ; Gadget Identification
  532.         Dc.L    $00                ; no User Data
  533.  
  534. GadOK1:
  535.  
  536. ; Gadget structure
  537.  
  538.         Dc.L    $00                ; no more gadgets for this window
  539.         Dc.W    $D2                ; x-offset on window
  540.         Dc.W    $2F                ; y-offset on window
  541.         Dc.W    $2A                ; gadget width
  542.         Dc.W    $0D                ; gadget height
  543.         Dc.W    $04                ; Inverted Image type
  544.         Dc.W    $01                ; RELVERIFY
  545.         Dc.W    $01                ; BOOLEAN
  546.         Dc.L    OK                 ; Data for picture of gadget
  547.         Dc.L    $00                ; no other image
  548.         Dc.L    $00                ; no text around gadget
  549.         Dc.L    $00,$00            ; no exclude,no special info
  550.         Dc.W    $03                ; Gadget Identification
  551.         Dc.L    $00                ; no User Data
  552.  
  553. GadOK2:
  554.  
  555. ; Gadget structure
  556.  
  557.         Dc.L    GadRepeat          ; no more gadgets for this window
  558.         Dc.W    $01BE              ; x-offset on window
  559.         Dc.W    $34                ; y-offset on window
  560.         Dc.W    $2A                ; gadget width
  561.         Dc.W    $0D                ; gadget height
  562.         Dc.W    $04                ; Inverted Image type
  563.         Dc.W    $01                ; RELVERIFY
  564.         Dc.W    $01                ; BOOLEAN
  565.         Dc.L    OK                 ; Data for picture of gadget
  566.         Dc.L    $00                ; no other image
  567.         Dc.L    $00                ; no text around gadget
  568.         Dc.L    $00,$00            ; no exclude,no special info
  569.         Dc.W    $01                ; Gadget Identification
  570.         Dc.L    $00                ; no User Data
  571.  
  572. GadRepeat:
  573.  
  574. ; Gadget structure
  575.  
  576.         Dc.L    $00                ; no more gadgets for this window
  577.         Dc.W    $017C              ; x-offset on window
  578.         Dc.W    $34                ; y-offset on window
  579.         Dc.W    $3D                ; gadget width
  580.         Dc.W    $0D                ; gadget height
  581.         Dc.W    $04                ; Inverted Image type
  582.         Dc.W    $01                ; RELVERIFY
  583.         Dc.W    $01                ; BOOLEAN
  584.         Dc.L    Repeat             ; Data for picture of gadget
  585.         Dc.L    $00                ; no other image
  586.         Dc.L    $00                ; no text around gadget
  587.         Dc.L    $00,$00            ; no exclude,no special info
  588.         Dc.W    $02                ; Gadget Identification
  589.         Dc.L    $00                ; no User Data
  590.  
  591. Inputtxt:
  592.  
  593. ; Intuitext structure
  594.  
  595.         Dc.B    $01,$01,$00        ; FrontPen,BackPen,DrawMode
  596.  
  597.         Even                       ; Fill to make even address for word
  598.  
  599.         Dc.W    $38,$0E            ; Left edge, top edge
  600.         Dc.L    $00                ; No special font
  601.         Dc.L    Inputtx            ; The actual text
  602.         Dc.L    $00                ; No next text
  603.  
  604. MSTitletxt:
  605.  
  606. ; Intuitext structure
  607.  
  608.         Dc.B    $01,$03,$05        ; FrontPen,BackPen,DrawMode
  609.  
  610.         Even                       ; Fill to make even address for word
  611.  
  612.         Dc.W    $00,$00            ; Left edge, top edge
  613.         Dc.L    $00                ; No special font
  614.         Dc.L    MSTitletx          ; The actual text
  615.         Dc.L    $00                ; No next text
  616.  
  617. Temptxt:
  618.  
  619. ; Intuitext structure
  620.  
  621.         Dc.B    $02,$01,$00        ; FrontPen,BackPen,DrawMode
  622.  
  623.         Even                       ; Fill to make even address for word
  624.  
  625.         Dc.W    $00,$00            ; Left edge, top edge
  626.         Dc.L    $00                ; No special font
  627.         Dc.L    Tempbuff           ; The actual text
  628.         Dc.L    $00                ; No next text
  629.  
  630. Timetxt:
  631.  
  632. ; Intuitext structure
  633.  
  634.         Dc.B    $01,$00,$01        ; FrontPen,BackPen,DrawMode
  635.  
  636.         Even                       ; Fill to make even address for word
  637.  
  638.         Dc.W    $32,$00            ; Left edge, top edge
  639.         Dc.L    $00                ; No special font
  640.         Dc.L    Timetx             ; The actual text
  641.         Dc.L    $00                ; No next text
  642.  
  643. Messageinfo:
  644.  
  645. ; Stringinfo structure
  646.  
  647.         Dc.L    Messagebuff        ; Buffer for input text
  648.         Dc.L    Undobuff           ; Buffer for undo function (Amiga-Q)
  649.         Dc.W    $00                ; Buffer start position
  650.         Dc.W    $80                ; Number of characters
  651.         Dc.W    $00,$00,$00        ; DispPos,UndoPos,NumChars
  652.         Dc.W    $00,$00,$00        ; DispCount,CLeft,CTop
  653.         Dc.L    $00,$00,$00        ; Layer,LongInt,Keymap
  654.  
  655. Minutesinfo:
  656.  
  657. ; Stringinfo structure
  658.  
  659.         Dc.L    Timebuff           ; Buffer for input text
  660.         Dc.L    Undotimebuff       ; Buffer for undo function (Amiga-Q)
  661.         Dc.W    $00                ; Buffer start position
  662.         Dc.W    $05                ; Number of characters
  663.         Dc.W    $00,$00,$00        ; DispPos,UndoPos,NumChars
  664.         Dc.W    $00,$00,$00        ; DispCount,CLeft,CTop
  665.         Dc.L    $00,$00,$00        ; Layer,LongInt,Keymap
  666.  
  667. ; Memory allocations
  668.  
  669. _intuitionbase: Ds.L    $01        ; memory for intuition base
  670. _dosbase:       Ds.L    $01        ; memory for dos base
  671. Winhd:          Ds.L    $01        ; memory for window handle
  672. Returnmsg:      Ds.L    $01        ; memory for WB return message
  673. Message:        Ds.L    $01        ; memory for WB return message
  674. xoff:           Dc.L    $10        ; declare x-offset
  675. yoff:           Dc.L    $10        ; declare y-offset
  676. Messagebuff:    Ds.B    $80        ; memory for message buffer
  677. Timebuff:       Ds.B    $05        ; memory for time buffer
  678. Undobuff:       Ds.B    $80        ; memory for message Undo
  679. Undotimebuff:   Ds.B    $05        ; memory for time Undo
  680. Tempbuff:       Ds.B    $3C        ; memory for temporary buffer
  681.  
  682. ;       Other text
  683.  
  684. Inputtx:        Dc.B    "Enter Message",$00
  685. Timetx:         Dc.B    "Minutes",$00
  686. MSTitletx:      Dc.B    "Your Message:",$00
  687. Winname:        Dc.B    "A N Peck - 1995",$00
  688. NoInput:        Dc.B    "Enter a Message!",$00
  689. NoTime:         Dc.B    "Enter a Time!",$00
  690. Screentitle:    Dc.B    "Freeware - enjoy in good health",$00
  691. Intname:        Dc.B    "intuition.library",$00  ; intuition library name
  692. Dosname:        Dc.B    "dos.library",$00        ; dos library name
  693.  
  694. ; Image Data
  695. ; ----------
  696. ;
  697. ; Here are the images used, all converted by the wonderful program
  698. ; Convbrush by David Kinder.  There are various other similar
  699. ; utilities, but I like this one because it was written in Pascal!
  700. ; Using such images blows out the size of the executable a bit, but
  701. ; gosh it looks pretty!
  702.  
  703.         Section Image,Data_C
  704.  
  705. InMessage       Dc.W    -$07,-$03,240,15,2
  706.                 Dc.L    InMessagedat
  707.                 Dc.B    3,0
  708.                 Dc.L    0
  709. InMessagedat    Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  710.                 Dc.W    00000,00000,00000,00000,00000,00000,00256,16383
  711.                 Dc.W    65535,65535,65535,65535,65535,65535,65535,65535
  712.                 Dc.W    65535,65535,65535,65535,65535,64256,12288,00000
  713.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  714.                 Dc.W    00000,00000,00000,00000,00768,12288,00000,00000
  715.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  716.                 Dc.W    00000,00000,00000,00768,12288,00000,00000,00000
  717.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  718.                 Dc.W    00000,00000,00768,12288,00000,00000,00000,00000
  719.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  720.                 Dc.W    00000,00768,12288,00000,00000,00000,00000,00000
  721.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  722.                 Dc.W    00768,12288,00000,00000,00000,00000,00000,00000
  723.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00768
  724.                 Dc.W    12288,00000,00000,00000,00000,00000,00000,00000
  725.                 Dc.W    00000,00000,00000,00000,00000,00000,00768,12288
  726.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  727.                 Dc.W    00000,00000,00000,00000,00000,00768,12288,00000
  728.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  729.                 Dc.W    00000,00000,00000,00000,00768,12288,00000,00000
  730.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  731.                 Dc.W    00000,00000,00000,00768,12288,00000,00000,00000
  732.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  733.                 Dc.W    00000,00000,00768,08192,00000,00000,00000,00000
  734.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  735.                 Dc.W    00000,00768,32767,65535,65535,65535,65535,65535
  736.                 Dc.W    65535,65535,65535,65535,65535,65535,65535,65535
  737.                 Dc.W    65280
  738.                 Dc.W    65535,65535,65535,65535,65535,65535,65535,65535
  739.                 Dc.W    65535,65535,65535,65535,65535,65535,65024,49152
  740.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  741.                 Dc.W    00000,00000,00000,00000,00000,01024,49152,00000
  742.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  743.                 Dc.W    00000,00000,00000,00000,03072,49152,00000,00000
  744.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  745.                 Dc.W    00000,00000,00000,03072,49152,00000,00000,00000
  746.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  747.                 Dc.W    00000,00000,03072,49152,00000,00000,00000,00000
  748.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  749.                 Dc.W    00000,03072,49152,00000,00000,00000,00000,00000
  750.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  751.                 Dc.W    03072,49152,00000,00000,00000,00000,00000,00000
  752.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,03072
  753.                 Dc.W    49152,00000,00000,00000,00000,00000,00000,00000
  754.                 Dc.W    00000,00000,00000,00000,00000,00000,03072,49152
  755.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  756.                 Dc.W    00000,00000,00000,00000,00000,03072,49152,00000
  757.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  758.                 Dc.W    00000,00000,00000,00000,03072,49152,00000,00000
  759.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  760.                 Dc.W    00000,00000,00000,03072,49152,00000,00000,00000
  761.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  762.                 Dc.W    00000,00000,03072,57343,65535,65535,65535,65535
  763.                 Dc.W    65535,65535,65535,65535,65535,65535,65535,65535
  764.                 Dc.W    65535,64512,32768,00000,00000,00000,00000,00000
  765.                 Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
  766.                 Dc.W    00000
  767.  
  768. Time            Dc.W    -$07,-$03,64,14,2
  769.                 Dc.L    Timedat
  770.                 Dc.B    3,0
  771.                 Dc.L    0
  772. Timedat         Dc.W    00000,00000,00000,02048,16383,65535,65535,55296
  773.                 Dc.W    12288,00000,00000,06144,12288,00240,00000,06144
  774.                 Dc.W    12288,00408,00000,06144,12288,00440,00000,06144
  775.                 Dc.W    12288,00504,00000,06144,12288,00472,00000,06144
  776.                 Dc.W    12288,00408,00000,06144,12288,00240,00000,06144
  777.                 Dc.W    12288,00000,00000,06144,12288,00000,00000,06144
  778.                 Dc.W    08192,00000,00000,06144,32767,65535,65535,63488
  779.                 Dc.W    65535,65535,65535,61440,49152,00000,00000,08192
  780.                 Dc.W    49152,00000,00000,24576,49152,00000,00000,24576
  781.                 Dc.W    49152,00000,00000,24576,49152,00000,00000,24576
  782.                 Dc.W    49152,00000,00000,24576,49152,00000,00000,24576
  783.                 Dc.W    49152,00000,00000,24576,49152,00000,00000,24576
  784.                 Dc.W    49152,00000,00000,24576,49152,00000,00000,24576
  785.                 Dc.W    57343,65535,65535,57344,32768,00000,00000,00000
  786.  
  787. Repeat          dc.w    0,0,61,13,2
  788.                 dc.l    Repeatdat
  789.                 dc.b    3,0
  790.                 dc.l    0
  791. Repeatdat       dc.w    00000,00000,00000,00008,00000,00000,00000,00024
  792.                 dc.w    00000,00000,00000,00024,00248,64760,64632,64536
  793.                 dc.w    00204,49356,49356,12312,00204,49356,49356,12312
  794.                 dc.w    00248,61688,61692,12312,00216,49344,49356,12312
  795.                 dc.w    00204,49344,49356,12312,00204,64704,64716,12312
  796.                 dc.w    00000,00000,00000,00024,00000,00000,00000,00024
  797.                 dc.w    32767,65535,65535,65528
  798.                 dc.w    65535,65535,65535,65520,49152,00000,00000,00000
  799.                 dc.w    49152,00000,00000,00000,49152,00000,00000,00000
  800.                 dc.w    49152,00000,00000,00000,49152,00000,00000,00000
  801.                 dc.w    49152,00000,00000,00000,49152,00000,00000,00000
  802.                 dc.w    49152,00000,00000,00000,49152,00000,00000,00000
  803.                 dc.w    49152,00000,00000,00000,49152,00000,00000,00000
  804.                 dc.w    32768,00000,00000,00000
  805.  
  806. OK              Dc.W    0,0,42,13,2
  807.                 Dc.L    OKdat
  808.                 Dc.B    3,0
  809.                 Dc.L    0
  810. OKdat           Dc.W    00000,00000,00064,00000,00000,00192,00000,00000
  811.                 Dc.W    00192,00001,58928,00192,00003,13920,00192,00003
  812.                 Dc.W    14016,00192,00003,14208,00192,00003,14016,00192
  813.                 Dc.W    00003,13920,00192,00001,58928,00192,00000,00000
  814.                 Dc.W    00192,00000,00000,00192,32767,65535,65472
  815.                 Dc.W    65535,65535,65408,49152,00000,00000,49152,00000
  816.                 Dc.W    00000,49152,00000,00000,49152,00000,00000,49152
  817.                 Dc.W    00000,00000,49152,00000,00000,49152,00000,00000
  818.                 Dc.W    49152,00000,00000,49152,00000,00000,49152,00000
  819.                 Dc.W    00000,49152,00000,00000,32768,00000,00000
  820.  
  821.                 End     ; Adios Amigoids
  822.  
  823.